#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#create one List
list1=['Google','Baidu',220,False]
#get one item
print(list1[1])
print(list1[-1])
#get some items
print(list1[1:-1])
#update list
list1[2]=221
print('update',list1[2])
#calc about list
list2=['Robin',True]
print('calc(+)',list1+list2)
list3=' Keep'*3
print('calc(*)',list3)
print('check:','aaa'in  list3)
print('len:',len(list3))
for x in [1,2,3]: print(x,end='')
list4=[1,2,3]
print("list4(*)",list4*3)

#Nested array
a=['a','b','c']
n=[1,2,3]
x=[a,n]
print(x[1][2])
#List func
list5=[9,45,223,5,7,11,68,9,101]
print('max func:',max(list5))
print('min func:',min(list5))
print('len func:',len(list5))
tuple=(23,46,98)
list6=list(tuple)
print('list func:',list6)# convert tuple to list

#method
list7=[]
#add one item to the end of list
list7.append(10)
list7.append(False)
print("list7-1",list7)
#add one sequence to the end of list
tuple2=(23,'Robin',False,"male",'xxx')
list7.extend(tuple2)
print("list7-2",list7)
#add one item to the given position of list
list7.insert(2,111)
print("list7-3",list7)
#del one item from list
list7.remove('xxx') #it will throw error when the item is not in list
list7.pop()#the default is the last one
print("list7-4",list7)
#count-count the frequency of one item in list
print('count:',list7.count(False))
#
